$(document).ready(function(){
	var Id=$('#Id').val();
	initForm(Id);
	eventBind();
	var next=$("#flup_status").val();
	if(next=='2'){
		$("#nexttime").show();
	}
});
function initForm(Id){
	$('#viewForm').validation();
	
	if(Id==''){
		
	}else{
		$.getApiClient('/flup/select/{id}').setQuery({id: Id}).get().done(function(data){
			if(data.code=='0'){
				var payload=data.payload;
				payload.next_time=$.dateFormatToString(new Date(payload.next_time),'yyyy-MM-dd HH:mm');
				$('#viewForm').bindData(payload);
				genDictSelect('flupCode','flup_type',payload.flup_type);
				genDictSelect('isFlup','flup_status',payload.flup_status);
			}
		})
	}
}
//事件绑定
function eventBind(){
	$('#cancel1').click(function(){
		BootstrapDialog.closeAll();
	})
}
